﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BusinessLogicTier.BLL;
using BusinessLogicTier.DAL.DataContext;
using Core;
using DevExpress.Utils;

namespace QLBH.Danhmuc
{
    public partial class FrmDVT : Form, iFormBaseList
    {
        private WaitDialogForm waitLoad = null;
        private DonViTinh_BLL objBll = new DonViTinh_BLL();
        private Utils util = new Utils();
        private QLBHDataContext db = null;
        private Log _logFile = new Log();
        FrmDVT_Them frmDvtThem = new FrmDVT_Them();
        public static int checkClick, idDvt;

        public FrmDVT()
        {
            InitializeComponent();
            frmDvtThem.frmDonViTinh = this;
        }

        private void btnThemDVT_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmDvtThem.Show();
        }

        public void MeShow()
        {}

        private void LoadGrid()
        {
            waitLoad = new WaitDialogForm("Đang nạp dữ liệu", "Xin vui lòng chờ...");
            waitLoad.Caption = "Tải danh sách...";
            gridControlDvt.DataSource = objBll.GetAll();
            waitLoad.Caption = "Hoàn thành";
            waitLoad.Dispose();
        }

        private void FrmDVT_Load(object sender, EventArgs e)
        {
            LoadGrid();
        }
    }
}
